<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
</head>
<style>
    .box{
        width: 200px;
        height: 100px;
        border: 1px solid black;
        display: flex;
        justify-content:space-between;
        align-items: center;
    }
    button{
        height: 50px;
    }
</style>
<body>
    <div id="app">
        <h3>小王售卖</h3>
        <div class="box">
            
            <button @click="fun(5)">可乐5元</button>
            <button @click="fun(10)">咖啡10元</button>
        </div>  
          <p>银行卡余额{{mony}}</p>
    </div>

</body>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            mony:999,
        },
        methods: {
            fun(num){
                this.mony-=num
            }
        }
    })
</script>

</html>